﻿@using EquipmentAlarmSystem.Service.Models.Enum
@model EquipmentGroupingSettingsModel

@{
    ViewData["Title"] = "设备分组";
}

<partial name="_SystemConfiguration" />


<style>
    table {
        border-collapse: collapse; /* 合并表格边框为一个单一的边框 */
    }

    table, th, td {
        border: 1px solid black; /* 设置表格、表头和表格单元格的边框为1像素宽的黑色实线 */
        text-align: center; /* 水平居中 */
    }

    tr {
        height: 35px;
    }
</style>

@foreach (var item in Model.AuthorizationList.Keys)
{
    <table>
        <tr>
            <th width="250px">@item</th>
        </tr>
        <tr>
            <th width="250px"></th>
            @foreach (var itemValue in Model.AuthorizationList[item])
            {
                <th width="150px">@itemValue</th>
            }
        </tr>
    </table>
    <br>
    <hr>
}

<form action="/AuthorizationManagement/EquipmentGrouping" method="post">

    <label for="Operations">操作:</label>
    <select asp-items="Html.GetEnumSelectList<Operation>()" name="Operations"></select>

    <label for="ClientId">客户端:</label>
    <select name="ClientId">
        @foreach (var items in Model.ClientList)
        {
            <option value="@items">@items</option>
        }
    </select>

    <label for="Grouping">分组:</label>
    <select name="Grouping">
        @foreach (var items in Model.GroupList)
        {
            <option value="@items">@items</option>
        }
    </select>
    <input type="submit" value="提交">
</form>
@if (Model.Content is not null && Model.Content.Length > 1)
{
    <br>
    <hr>
    <h1>@Model.Content</h1>
}
